package com.pinganfu.tesla.iwallet;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

import com.pinganfu.tesla.iwallet.util.TeslaUtil;
import com.pinganfu.tesla.iwallet.util.ToastUtil;
import compinganfu.tesla.iwallet.widget.EditTextWithDel;

public class UnbindCardActivity extends Activity implements OnClickListener {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_unbind_card);

		TextView tvCardNo = (TextView) findViewById(R.id.tv_card_no);
		String cardNo = getIntent().getStringExtra("cardNo");
		tvCardNo.setText("解綁 " + cardNo + " 的银行卡");

		Button btnUnbind = (Button) findViewById(R.id.btn_unbind);
		btnUnbind.setOnClickListener(this);
		Button btnCancel = (Button) findViewById(R.id.btn_cancel);
		btnCancel.setOnClickListener(this);

		EditTextWithDel txtPayPwd = (EditTextWithDel) findViewById(R.id.txt_pay_pwd);
		txtPayPwd.setActionButton(btnUnbind);
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
			case R.id.btn_cancel :
				finish();
				break;
			case R.id.btn_unbind :
				ToastUtil.show(this, R.string.msg_unbind_succ);
				TeslaUtil.gotoActivity(this, MainActivity.class);
				break;
		}
	}
}
